package com.example.monitoringsystem.controller;


import com.example.monitoringsystem.bean.ExceptionPatient;
import com.example.monitoringsystem.bean.Health;
import com.example.monitoringsystem.service.ExceptionHeanlthNotifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ExceptionPatientController {
    @Autowired
    private ExceptionHeanlthNotifyService exceptionHeanlthNotifyService;

    // 获取未识别的健康信息
    @RequestMapping("/health/getNotRecognize")
    public List<Health> getNotRecognize(){
        return exceptionHeanlthNotifyService.getAllNotRecognizeHealth();
    }

    // 获取识别后异常的健康信息
    @RequestMapping("/health/getExceptionHealth")
    public List<Health> getExceptionHealth(){
        return exceptionHeanlthNotifyService.getExceptionHealth();
    }

    // 通知医生
    @RequestMapping("/health/sendNotify")
    public void sendNotify(){
        exceptionHeanlthNotifyService.sendNotify();
    }

    // 医生获取自己的病人
    @RequestMapping("/doctor/getNotify")
    public List<ExceptionPatient> getNotify(@RequestParam("doctorId") Integer doctorId){
        return exceptionHeanlthNotifyService.getNotify(doctorId);
    }
}
